package com.pingan.agentbank.aaos.testme;

import com.pingan.agentbank.aaos.pojo.ApproLineInfo;
import com.pingan.agentbank.aaos.util.WholeToHalfUtil;
import com.pingan.vframe.sdo.ServiceData;
import com.pingan.vframe.util.JSON;
import com.pingan.vframe.util.JSONCaseType;
import org.junit.Test;

public class WRCBFieldTest {

    public ApproLineInfo approLineInfo = new ApproLineInfo();
    public ServiceData serviceData = new ServiceData();

    public void method1(){

        approLineInfo = WholeToHalfUtil.convertBean(approLineInfo);

        serviceData.putString("chinese_name",approLineInfo.getChinese_name());
        serviceData.putString("sex",approLineInfo.getSex());
        serviceData.putString("birth_date",approLineInfo.getBirth_date());
        serviceData.putString("owner_name",approLineInfo.getOwner_name());
        serviceData.putString("mobile",approLineInfo.getMobile());
        serviceData.putString("global_type",approLineInfo.getGlobal_type());
        serviceData.putString("global_id",approLineInfo.getGlobal_id());
        serviceData.putString("global_eff_enddate",approLineInfo.getGlobal_eff_enddate());
        serviceData.putString("marital_status",approLineInfo.getMarital_status());
        serviceData.putString("education",approLineInfo.getEducation());
        serviceData.putString("address1",approLineInfo.getAddress1());
        serviceData.putString("address2",approLineInfo.getAddress2());
        serviceData.putString("address3",approLineInfo.getAddress3());
        serviceData.putString("address4",approLineInfo.getAddress4());
        serviceData.putString("postcode",approLineInfo.getPostcode());
        serviceData.putString("residential_type",approLineInfo.getResidential_type());
        serviceData.putString("companyname",approLineInfo.getCompanyname());
        serviceData.putString("departname",approLineInfo.getDepartname());
        serviceData.putString("post",approLineInfo.getPost());
        serviceData.putString("employer_add1",approLineInfo.getEmployer_add1());
        serviceData.putString("employer_add2",approLineInfo.getEmployer_add2());
        serviceData.putString("employer_add3",approLineInfo.getEmployer_add3());
        serviceData.putString("employer_add4",approLineInfo.getEmployer_add4());
        serviceData.putString("employer_postcode",approLineInfo.getEmployer_postcode());

        String employer_phone = "";
        if (approLineInfo.getEmployer_phone()==null || "".equals(approLineInfo.getEmployer_phone())){
            employer_phone = "0";
        } else {
            employer_phone = approLineInfo.getEmployer_phone();
        }

        serviceData.putString("employer_phone",employer_phone);
        serviceData.putString("working_years",approLineInfo.getWorking_years());
        serviceData.putString("immidediate_name",approLineInfo.getImmidediate_name());
        serviceData.putString("immidediate_relation",approLineInfo.getImmidediate_relation());
        serviceData.putString("immidediate_mobile",approLineInfo.getImmidediate_mobile());
        serviceData.putString("other_name",approLineInfo.getOther_name());
        serviceData.putString("other_relation",approLineInfo.getOther_relation());
        serviceData.putString("other_mobile",approLineInfo.getOther_mobile());
        serviceData.putString("sales_company_code",approLineInfo.getSales_company_code());
        serviceData.putString("creditcardCategory",approLineInfo.getCreditcardcategory());
        serviceData.putString("creditcardType",approLineInfo.getCreditcardtype());
        serviceData.putString("collection_no",approLineInfo.getCollection_no());
        serviceData.putString("bar_code",approLineInfo.getBar_code());
        serviceData.putString("affinityCode",approLineInfo.getAffinitycode());
        serviceData.putString("campaign_code",approLineInfo.getCampaign_code());
        //serviceData.putString("giveCardCity",WholeToHalfUtil.convert(approLineInfo.getGivecardcity()));
        serviceData.putString("onlineSQFlag",approLineInfo.getOnlineSQFlag());
        serviceData.putString("applicationFlag",approLineInfo.getApplicationflag());
        serviceData.putString("audit_result",approLineInfo.getAudit_result());
        serviceData.putString("expand_branch",approLineInfo.getExpand_branch());
        serviceData.putString("email",approLineInfo.getEmail());
        serviceData.putString("country_citizen",approLineInfo.getCountry_citizen());
        serviceData.putString("global_eff_flag",approLineInfo.getGlobal_eff_flag());
        serviceData.putString("issuing_authority",approLineInfo.getIssuing_authority());
        serviceData.putString("children_flag",approLineInfo.getChildren_flag());
        serviceData.putString("phone_area",approLineInfo.getPhone_area());
        serviceData.putString("home_phone",approLineInfo.getHome_phome());
        serviceData.putString("employer_phone_areano",approLineInfo.getEmployer_phone_areano());
        serviceData.putString("company_type",approLineInfo.getCompany_type());
        serviceData.putString("annual_income",approLineInfo.getAnnual_income());
        serviceData.putString("ex_working_years",approLineInfo.getEx_working_years());
        serviceData.putString("car_number",approLineInfo.getCar_number());
        serviceData.putString("car_brand",approLineInfo.getCar_brand());
        serviceData.putString("application_tool",approLineInfo.getApplication_tool());
        serviceData.putString("applytime",approLineInfo.getApplytime());
        serviceData.putString("upload_cardtye",approLineInfo.getUpload_cardtye());
        serviceData.putString("channel_id",approLineInfo.getChannel_id());
        serviceData.putString("expand_source",approLineInfo.getExpand_source());
        serviceData.putString("monthly_mortgage_payment",approLineInfo.getMonthly_mortgage_payment());
        serviceData.putString("reside_add1",approLineInfo.getReside_add1());
        serviceData.putString("reside_add2",approLineInfo.getReside_add2());
        serviceData.putString("reside_add3",approLineInfo.getReside_add3());
        serviceData.putString("reside_add4",approLineInfo.getReside_add4());
        serviceData.putString("reside_postcode",approLineInfo.getReside_postcode());
        serviceData.putString("amount",approLineInfo.getAmount());
        serviceData.putString("refuse_code",approLineInfo.getRefuse_code());
        serviceData.putString("payment_limit_type",approLineInfo.getPayment_limit_type());
        serviceData.putString("job_code",approLineInfo.getJob_code());
        serviceData.putString("card_down",approLineInfo.getCard_down());

    }

    public void method2(){
        String str = JSON.fromServiceData(serviceData, JSONCaseType.DEFAULT);
        str = str.replace("\n","");
    }

    @Test
    public void method3(){
        serviceData.putString("chinese_name",approLineInfo.getChinese_name());
        serviceData.putString("sex",approLineInfo.getSex());
        serviceData.putString("birth_date",approLineInfo.getBirth_date());
        serviceData.putString("owner_name",approLineInfo.getOwner_name());
        serviceData.putString("mobile",approLineInfo.getMobile());
        serviceData.putString("global_type",approLineInfo.getGlobal_type());
        serviceData.putString("global_id",approLineInfo.getGlobal_id());
        serviceData.putString("global_eff_enddate",approLineInfo.getGlobal_eff_enddate());
        serviceData.putString("marital_status",approLineInfo.getMarital_status());
        serviceData.putString("education",approLineInfo.getEducation());
        serviceData.putString("address1",approLineInfo.getAddress1());
        serviceData.putString("address2",approLineInfo.getAddress2());
        serviceData.putString("address3",approLineInfo.getAddress3());
        serviceData.putString("address4",approLineInfo.getAddress4());
        serviceData.putString("postcode",approLineInfo.getPostcode());
        serviceData.putString("residential_type",approLineInfo.getResidential_type());
        serviceData.putString("companyname",approLineInfo.getCompanyname());
        serviceData.putString("departname",approLineInfo.getDepartname());
        serviceData.putString("post",approLineInfo.getPost());
        serviceData.putString("employer_add1",approLineInfo.getEmployer_add1());
        serviceData.putString("employer_add2",approLineInfo.getEmployer_add2());
        serviceData.putString("employer_add3",approLineInfo.getEmployer_add3());
        serviceData.putString("employer_add4",approLineInfo.getEmployer_add4());
        serviceData.putString("employer_postcode",approLineInfo.getEmployer_postcode());
        serviceData.putString("employer_phone",approLineInfo.getEmployer_phone());
        serviceData.putString("working_years",approLineInfo.getWorking_years());
        serviceData.putString("immidediate_name",approLineInfo.getImmidediate_name());
        serviceData.putString("immidediate_relation",approLineInfo.getImmidediate_relation());
        serviceData.putString("immidediate_mobile",approLineInfo.getImmidediate_mobile());
        serviceData.putString("other_name",approLineInfo.getOther_name());
        serviceData.putString("other_relation",approLineInfo.getOther_relation());
        serviceData.putString("other_mobile",approLineInfo.getOther_mobile());
        serviceData.putString("sales_company_code",approLineInfo.getSales_company_code());
        serviceData.putString("creditcardCategory",approLineInfo.getCreditcardcategory());
        serviceData.putString("creditcardType",approLineInfo.getCreditcardtype());
        serviceData.putString("collection_no",approLineInfo.getCollection_no());
        //serviceData.putString("out_apply_no",approLineInfo.getOut_apply_no());
        serviceData.putString("bar_code",approLineInfo.getBar_code());
        serviceData.putString("affinityCode",approLineInfo.getAffinitycode());
        serviceData.putString("campaign_code",approLineInfo.getCampaign_code());
        serviceData.putString("giveCardCity ",approLineInfo.getGivecardcity());
        serviceData.putString("onlineSQFlag",approLineInfo.getOnlineSQFlag());
        serviceData.putString("audit_result",approLineInfo.getAudit_result());

    }
}
